package com.ss.android.image;

import android.content.Context;
import android.support.annotation.Nullable;
import android.util.AttributeSet;

import com.facebook.common.internal.ToStringHelper;
import com.facebook.drawee.interfaces.DraweeController;
import com.facebook.drawee.interfaces.SettableDraweeHierarchy;
import com.facebook.drawee.view.DraweeHolder;
import com.ss.android.common.imagezoom.ImageViewTouch;

public class DraweeImageViewTouch extends ImageViewTouch {
    private DraweeHolder n;

    public DraweeImageViewTouch(Context arg2, AttributeSet arg3) {
        super(arg2, arg3);
        this.n = new DraweeHolder();
    }

    @Nullable
    public DraweeController getController() {
        return this.n.mController;
    }

    public void setController(@Nullable DraweeController arg2) {
        this.n.setController(arg2);
        super.setImageDrawable(this.n.getTopLevelDrawable());
    }

    protected void onAttachedToWindow() {
        super.onAttachedToWindow();
        this.n.trim();
    }

    protected void onDetachedFromWindow() {
        super.onDetachedFromWindow();
        this.n.untrim();
    }

    public void onFinishTemporaryDetach() {
        super.onFinishTemporaryDetach();
        this.n.trim();
    }

    public void onStartTemporaryDetach() {
        super.onStartTemporaryDetach();
        this.n.untrim();
    }

    public void setHierarchy(SettableDraweeHierarchy arg2) {
        this.n.setHierarchy(arg2);
        super.setImageDrawable(this.n.getTopLevelDrawable());
    }

    public String toString() {
        ToStringHelper v1 = android.support.design.a.toStringHelper((Object) this);
        String v2 = "holder";
        String v0 = this.n != null ? this.n.toString() : "<no holder set>";
        return v1.add(v2, v0).toString();
    }
}

